<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>管理中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/main.css">
    <script src="lib/jquery-1.7.2.min.js" type="text/javascript"></script>

    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>



    <![endif]-->
    <style>
        .page-title{
            margin-top: 10px;
            color: #b8e095;
            text-align: center;
        }



    /*    图片轮播*/
        *{margin:0px;border: 0}
        .warp{
            margin-top:10px;
            margin-left: 80px;
            width: 1230px;
            height: 630px;
            position: relative;
            overflow: hidden;
            /*box-shadow: 0 5px 54px rgb(37, 34, 34);*/
        }
        .broadcast{
            margin:15px;
            width: 1200px;
            height: 600px;
            position: relative;
            overflow: hidden;
        }
        .broadcast ul{
            width: 400%;
            height: 100%;
            left: 0;
            top: 0;
            padding: 0;
            list-style: none;

        }
        .broadcast li{
            left: 0;
            float: left;
            list-style: none;
        }
        .broadcast img{
            width: 1200px;
            height: 600px;
        }
        .broadcast ol{
            position: absolute;
            right: 30px;
            bottom: 30px;
        }
        .broadcast ol li{
            position: relative;
            float: left;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: rgba(155, 155, 155,.45);
            color: #fff;
            text-align: center;
            margin-right: 15px;
            cursor: pointer;
            line-height: 20px;
        }
        .broadcast ol li.first-li{
            background-color:rgba(248, 248, 248, 0.45)
        }


    </style>
    <link rel="stylesheet" href="css/login.css">

    <script>


        //图片轮播效果
        window.onload = function () {
            var broadcast = document.getElementById("broadcast"),
                img_list = document.getElementById("img_list"),
                button_list = document.getElementById("button_list").getElementsByTagName("li"),
                index = 0,
                timer = null;
            //初始化
            if (timer) {
                clearInterval(timer);
                timer = null;
            }

            // 自动切换
            timer = setInterval(autoPlay, 1200);

            // 调用自动播放函数
            function autoPlay() {
                index++;
                if (index >= button_list.length) {
                    index = 0;
                }
                imgChange(index);
            }

            function imgChange(buttonIndex) {
                for (let i = 0; i < button_list.length; i++) {
                    button_list[i].className="";
                }
                button_list[buttonIndex].className = "first-li";//按钮样式切换
                img_list.style.marginLeft = -1200 * buttonIndex + "px";
                index = buttonIndex;
            }
            //鼠标接触div
            broadcast.onmouseover = function(){
                clearInterval(timer);

            }
            //鼠标离开div
            broadcast.onmouseout = function(){
                timer = setInterval(autoPlay, 2000);
            }
            //鼠标悬停ol
            for (var i = 0; i < button_list.length; i++) {
                button_list[i].id = i;
                button_list[i].onmouseover = function() {
                    clearInterval(timer);
                    imgChange(this.id);
                }
            }
        }

    </script>

</head>
<body>
<!--the top nav begin-->
<div class="navbar navbar-default" role="navigation">
    <div class="navbar-inner">
        <div class="navbar-header">
            <a class="navbar-brand" href="index.html">茶韵商城后台系统</a>
        </div>
        <ul class="nav navbar-nav pull-right" >
            <li id= "fat-menu" class="dropdown">
                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-user"></span> 用户名
                    <span class="glyphicon glyphicon-chevron-down"></span>
                </a>
                <ul class="dropdown-menu" role="menu">
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="updateadmin.html">我的账户</a></li>
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="login.html" id="outLink2">登出</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<!--the top nav end-->
<!--the sidebar nav begin -->
<div class="sidebar-nav">
    <a href="index.html" class="nav-header" ><span class="glyphicon glyphicon-home"></span> 管理中心 首页</a>

    <a href="category.html" class="nav-header"><span class="glyphicon glyphicon-hd-video"></span> 分类管理</a>

    <a href="product.html" class="nav-header"><span class="glyphicon glyphicon-eye-open"></span> 商品管理 </a>

    <a href="order.html" class="nav-header"><span class="glyphicon glyphicon-eye-open"></span> 订单管理 </a>

    <a href="userlist.html" class="nav-header"><span class="glyphicon glyphicon-eye-open"></span> 账户管理</a>

    <a id="outLink" href="login.html" class="nav-header" ><span class="glyphicon glyphicon-log-out"></span> 登出</a>
</div>
<!--the siderbar nav en-->

<div class="content">
        <!--the home stats end and page title begin-->
    <h1 class="page-title">茶韵商城<span>.</span>甄选好茶</h1>
        <br>
        <h2 class="page-title">一片树叶的故事</h2>


    <div class="warp">
        <div class="broadcast" id="broadcast">
            <ul id="img_list">
                <li><img src="images/1.jpg" alt="1"></li>
                <li><img src="images/3.jpg" alt="2"></li>
                <li><img src="images/4.jpg" alt="3"></li>
                <li><img src="images/2.jpg" alt="4"></li>
            </ul>
            <ol id="button_list"> <!-- 轮播按钮 -->
                <li class="first-li" id="olli1">1</li>
                <li id="olli2">2</li>
                <li id="olli3">3</li>
                <li id="olli4">4</li>
            </ol>
        </div>
    </div>

    </div>


    </div>
    <script src="lib/bootstrap/js/bootstrap.js"></script>

</body>
</html>
